<template>
  <div class="home">
    <ul>
      <li v-for="item_stage in stage_list" :key="item_stage.id">
        <div class="class-body" v-for="item_chapter in item_stage.children" :key="item_chapter.id">
          <div
            class="class-item"
            @click="toStudy(item_class.id)"
            v-for="(item_class, index) in item_chapter.children"
            :key="item_class.id"
          >{{index + 1}}</div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeView',
  components: {
  },
  data () {
    return {
      img: '',
      index: 0,
      stage_list: JSON.parse(localStorage.getItem('stage_list'))
    }
  },
  methods: {
    toStudy (id) {
      this.$router.push('/study?id=' + id)
    }
  }
}
</script>

<style lang="less">
.home {
  padding: 0 4vw;
}
.class-body {
  display: flex;
  flex-wrap: wrap;
}
.class-item {
  margin: 3vw;
  width: 16vw;
  height: 16vw;
  border-radius: 2vw;
  border: 2px solid #999;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 6vw;
  font-weight: 700;
}
</style>
